from selenium.webdriver.common.by import By

from xinan_ui.proxy.base_page import BasePage, PageHandle


class PageFirst(BasePage):
    def __init__(self):
        super().__init__()
        self.loc01=By.XPATH,"""/hierarchy/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.LinearLayout/android.widget.TextView[2]"""
        self.loc02=By.XPATH,"""/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/androidx.viewpager.widget.ViewPager/android.widget.RelativeLayout/android.widget.TextView"""
        self.loc03=By.XPATH,"""/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.ImageView[1]"""
        self.loc04=By.XPATH,"""/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.LinearLayout/android.widget.LinearLayout/android.widget.TextView"""
        self.loc05=By.XPATH,""""/hierarchy/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.view.ViewGroup/android.widget.ImageView"""
        self.loc06=By.XPATH,"""/hierarchy/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.view.ViewGroup/android.widget.LinearLayout/android.widget.ImageView"""
        self.loc07=By.XPATH,"""/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.LinearLayout/android.widget.LinearLayout[3]/android.widget.ImageView"""

    def get_ele01(self):
        return self.get_element(self.loc01)
    def get_ele02(self):
        return self.get_element(self.loc02)
    def get_ele03(self):
        return self.get_element(self.loc03)
    def get_ele04(self):
        return self.get_element(self.loc04)
    def get_ele05(self):
        return self.get_element(self.loc05)
    def get_ele06(self):
        return self.get_element(self.loc06)
    def get_ele07(self):
        return self.get_element(self.loc07)

class HandleFirst(PageHandle):
    def __init__(self):
        super().__init__()
        self.x1=PageFirst()

    def click_ele(self):
        self.click_button(self.x1.get_ele01())
        # self.click_button(self.x1.get_ele02())
        # self.click_button(self.x1.get_ele03())
        # self.click_button(self.x1.get_ele04())
        # self.click_button(self.x1.get_ele05())
        # self.click_button(self.x1.get_ele06())
        # self.click_button(self.x1.get_ele07())

class EnterFir():
    def __init__(self):
        self.xn=HandleFirst()

    def enter_fir(self):
        self.xn.click_ele()


if __name__ == '__main__':
    F=EnterFir()
    F.xn.x.driver
    F.enter_fir()








